﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MyMainSite.Models.Admin
{
	public class ProjectModel : BaseAdminModel
	{
		public int ProjectId { get; set; }

		public string Name { get; set; }

		public List<ProjectBuild> ProjectBuilds { get; set; }

		public List<DeveloperComment> DeveloperComments { get; set; }

		public ProjectModel(Project project)
		{
			this.ProjectId = project.ProjectId;

			this.Name = project.Name;

			this.ProjectBuilds = project.ProjectBuilds.OrderByDescending(b => b.UploadDate).ToList();
			this.DeveloperComments = project.DeveloperComments.OrderByDescending(c => c.Date).ToList();
		}
	}
}